package elems;

import common.ParseException;
import common.Strings;

import java.io.Console;
import java.util.ArrayList;

public class Empty extends ClassElem {
    private Empty() {
        super(null);
    }

    public void print(int shift) {
        System.out.println(Strings.getSpaceShift(shift) + "/* EMPTY  */");
    }
    
    public static boolean is(int lineNum, String text) throws ParseException {
        ArrayList<String> strs=Strings.split(lineNum,text,"//",true,false);
        return strs.get(0).trim().length() == 0 && (strs.size() <=1 || strs.get(1).trim().length() == 0);
    }

    public static Empty get(int lineNum, String text) throws ParseException {
        if(!is(lineNum,text))
            return null;
        return new Empty();
    }
}
